Conversation
Update the Azure.Storage.Blobs package reference from 12.28.0 to 12.29.0 in the Moonglade.ImageStorage project. Run CI/build and review the package changelog for any relevant fixes or breaking changes.
Introduce a new highlight.js language definition for Kusto (KQL) at src/.../highlight.kusto.js. The file declares keywords, types, built-in functions and token patterns (strings, numbers, variables, comments, etc.). Also update post.highlight.mjs to import and register the new 'kusto' language so Kusto code blocks are highlighted in posts.
Add Kusto to TinyMCE codesample_languages so authors can select it in the editor (src/Moonglade.Web/wwwroot/js/app/admin.editor.module.mjs). Update AGENTS.md with guidance to register new highlight.js languages before hljs.highlightElement in src/Moonglade.Web/wwwroot/js/app/post.highlight.mjs and add them to the editor list. Bump AssemblyVersion/FileVersion to 15.17.0 and set Version to 15.17.0-preview.1 in src/Directory.Build.props.
Add a new FEATURE-ROADMAP.md that documents feature research, prioritized batches, and implementation notes for Moonglade (prepared 2026-06-08). Update AGENTS.md to add a documentation/licensing guideline requiring repository content to be written in English except for localization resources (e.g., *.resx or third-party language packs).
Extend search capabilities end-to-end. Backend: expand SearchPostQuery into a richer query (keyword, paging, category, tag, language, date range, sort) and return SearchPostQueryResult (Posts + TotalRows). Add SearchPostSort enum and refactor handler to normalize keywords, apply keyword and facet filters, count total rows, apply sorting and paging. UI: update Search.cshtml to provide a search form with sort, category/tag/language/date filters, paging controls, and localization support; wire the page to call the enhanced query and build PagedResult. Presentation: improve _PostListEntry highlighting to HTML-encode text and safely mark matched terms. Tests: update expectations and add tests for pagination/sorting and facet filtering; adjust test helper to accept languageCode. Docs: permit non-English values in unit tests and update roadmap note to avoid scanning full post bodies. Overall: implements safer highlighting, richer filtering/sorting, and paginated search results with UI and tests.
Replace hard-coded labels and option text in Search.cshtml with SharedLocalizer lookups (Sort, sort options, All categories, All tags, All languages, Published from/to, Clear and the result(s) message). Add corresponding translations for those keys in Program.resx for de-DE, ja-JP, zh-Hans and zh-Hant. No functional changes — this prepares the Search page for localization and uses localized plural formatting for the results count.
Expose post LastModifiedUtc in PostOperationResult and controller responses; include LastModifiedUtc when saving posts. Add auto-save feature in the post editor: UI toggle, CSS styling, persistent setting, interval timer, snapshot/validation logic and background save flow. Introduce localized strings and wire getLocalizedString into editor, form, schedule and slug mixins; update EditPost view to use SharedLocalizer and embed localized strings. Update multiple .resx resource files (de, ja, zh-Hans, zh-Hant) with new keys. Minor refactors: extract request/snapshot helpers and savePost method, and replace hardcoded messages with localized messages.
Expose post LastModifiedUtc in PostOperationResult and controller responses; include LastModifiedUtc when saving posts. Add auto-save feature in the post editor: UI toggle, CSS styling, persistent setting, interval timer, snapshot/validation logic and background save flow. Introduce localized strings and wire getLocalizedString into editor, form, schedule and slug mixins; update EditPost view to use SharedLocalizer and embed localized strings. Update multiple .resx resource files (de, ja, zh-Hans, zh-Hant) with new keys. Minor refactors: extract request/snapshot helpers and savePost method, and replace hardcoded messages with localized messages.
Add comprehensive SearchPageTests to verify search page rendering, query-string state preservation, pagination links, and redirect behavior when requested pages exceed available results. Register Microsoft.AspNetCore.TestHost in the test project to run the app via TestServer, and mock query mediator/cache to drive scenarios. Also update FEATURE-ROADMAP.md to mark optional web tests for the search page as completed.
Introduce a configurable rate limiter for webmention sources. Adds WebmentionSourceRateLimitOptions (Enabled, PermitLimit=10, WindowMinutes=10 with validation) and WebmentionSourceRateLimiter which implements TryAcquire(Uri) and enforces a per-source-host fixed time window using a ConcurrentDictionary of counters and a lock per counter. The limiter uses IOptionsMonitor, TimeProvider and logs a warning when a host exceeds its permit limit.
Introduce unit tests for WebmentionSourceRateLimiter covering: enforcement of per-source host permit limits, independent tracking of different source hosts, and behavior when the limiter is disabled. Tests use Moq to provide IOptionsMonitor<WebmentionSourceRateLimitOptions>, TimeProvider.System, and a mocked ILogger.
Introduce source-based rate limiting for Webmentions. Adds Webmention:SourceRateLimit options to appsettings, registers WebmentionSourceRateLimiter and TimeProvider in DI, and wires the limiter into the receive flow (ReceiveWebmentionCommandHandler returns SourceRateLimitExceeded when TryAcquire fails). Controller maps the new status to HTTP 429. WebmentionResponse and enum updated, service registration updated to accept IConfiguration, and tests extended to cover the rate-limit behavior. Also marks the feature as completed in FEATURE-ROADMAP.
Replace hard-coded admin and footer text with SharedLocalizer and localized data attributes, add hidden localized string containers for JS, and switch various UI labels, placeholders and aria labels to use localization. Update multiple admin pages (Comments, Draft, EditPage, LocalAccount, Menu, Post, Settings, Widgets, Shared footer) and corresponding client JS modules to consume localized strings. Mark JavaScript localization tasks as done in FEATURE-ROADMAP and add/expand resource entries (Program.*.resx) for supported locales.
Upgrade various Microsoft package references across multiple projects to apply patch updates. EF Core packages (Microsoft.EntityFrameworkCore, Relational, SqlServer, InMemory, Sqlite) moved from 10.0.8 to 10.0.9; Microsoft.Extensions.Http.Resilience updated from 10.6.0 to 10.7.0; Microsoft.Extensions.Diagnostics.HealthChecks.EntityFrameworkCore and Microsoft.Extensions.Logging.AzureAppServices to 10.0.9; test-related packages (Microsoft.AspNetCore.DataProtection, System.Security.Cryptography.Xml, Microsoft.AspNetCore.TestHost) also bumped to 10.0.9. Affected projects include Moonglade.Data.PostgreSql, Moonglade.Data.SqlServer, Moonglade.Data, Moonglade.Email.Client, Moonglade.IndexNow.Client, Moonglade.Moderation, Moonglade.Web, Moonglade.Webmention and multiple test projects. These updates keep dependencies consistent and ensure the latest patch fixes are applied.
Promote the build from beta to release candidate by updating the <Version> property in src/Directory.Build.props from 15.17.0-beta.1 to 15.17.0-rc.1. This prepares the project for an RC release.
Update src/Directory.Build.props to remove the prerelease suffix and set <Version> to 15.17.0. This promotes the package from the 15.17.0-rc.1 release candidate to the stable 15.17.0 release.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR bumps Moonglade to v15.17.0 and delivers a bundle of UX and platform improvements centered on enhanced site search, draft autosave, Webmention source rate limiting, and broader localization cleanup across admin/public UI.
Changes:
- Expand
/searchto support pagination, sorting, and facet/date filtering, plus safer keyword highlighting. - Add draft autosave UI/state handling in the post editor and standardize admin UI strings via localized string datasets.
- Introduce Webmention source-host rate limiting with a new
429 Too Many Requestsoutcome and tests; update dependencies to latest patch versions.
Reviewed changes
Copilot reviewed 70 out of 70 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| src/Tests/Moonglade.Webmention.Tests/WebmentionSourceRateLimiterTests.cs | Adds unit tests for the new source-host rate limiter. |
| src/Tests/Moonglade.Webmention.Tests/ReceiveWebmentionCommandHandlerTests.cs | Adds handler test for rate-limit exceeded behavior. |
| src/Tests/Moonglade.Webmention.Tests/Moonglade.Webmention.Tests.csproj | Updates EF Core InMemory package version. |
| src/Tests/Moonglade.Web.Tests/SearchPageTests.cs | Adds end-to-end TestServer coverage for the new search UI/query behavior. |
| src/Tests/Moonglade.Web.Tests/Moonglade.Web.Tests.csproj | Adds ASP.NET Core TestHost dependency. |
| src/Tests/Moonglade.Web.Tests/MentionControllerTests.cs | Verifies 429 mapping for source rate limit exceeded. |
| src/Tests/Moonglade.Theme.Tests/Moonglade.Theme.Tests.csproj | Updates EF Core InMemory package version. |
| src/Tests/Moonglade.Setup.Tests/Moonglade.Setup.Tests.csproj | Updates EF Core InMemory package version. |
| src/Tests/Moonglade.Features.Tests/PostQueryTests.cs | Updates tests for new SearchPostQueryResult shape and adds paging/filter/sort coverage. |
| src/Tests/Moonglade.Features.Tests/Moonglade.Features.Tests.csproj | Updates EF Core InMemory/Sqlite package versions. |
| src/Tests/Moonglade.Configuration.Tests/Moonglade.Configuration.Tests.csproj | Updates EF Core InMemory package version. |
| src/Tests/Moonglade.Auth.Tests/Moonglade.Auth.Tests.csproj | Updates ASP.NET Core/DataProtection and crypto package versions. |
| src/Moonglade.Webmention/WebmentionSourceRateLimitOptions.cs | Adds options model for source rate limiting configuration. |
| src/Moonglade.Webmention/WebmentionSourceRateLimiter.cs | Implements per-source-host in-memory rate limiting. |
| src/Moonglade.Webmention/WebmentionResponse.cs | Adds SourceRateLimitExceeded response/status. |
| src/Moonglade.Webmention/ServiceCollectionExtensions.cs | Wires rate limiter + options binding via DI. |
| src/Moonglade.Webmention/ReceiveWebmentionCommand.cs | Enforces source-host rate limiting in receive flow. |
| src/Moonglade.Webmention/Moonglade.Webmention.csproj | Updates Microsoft.Extensions.Http.Resilience package version. |
| src/Moonglade.Web/wwwroot/js/app/post.highlight.mjs | Registers Kusto language for highlight.js rendering. |
| src/Moonglade.Web/wwwroot/js/app/imageuploader.mjs | Switches toast/error strings to localized string lookups. |
| src/Moonglade.Web/wwwroot/js/app/admin.widgets.mjs | Localizes widget editor strings (e.g., display order validation). |
| src/Moonglade.Web/wwwroot/js/app/admin.settings.notification.mjs | Localizes “test email sent” toast string. |
| src/Moonglade.Web/wwwroot/js/app/admin.settings.appearance.mjs | Localizes “theme deleted” toast string. |
| src/Moonglade.Web/wwwroot/js/app/admin.editpost.slug.mjs | Localizes slug modification confirm modal content. |
| src/Moonglade.Web/wwwroot/js/app/admin.editpost.schedule.mjs | Localizes schedule status text rendering. |
| src/Moonglade.Web/wwwroot/js/app/admin.editpost.mjs | Adds draft autosave toggle/state, snapshots, and localized UI strings. |
| src/Moonglade.Web/wwwroot/js/app/admin.editpost.form.mjs | Localizes unsaved-changes beforeunload message. |
| src/Moonglade.Web/wwwroot/js/app/admin.editpage.mjs | Localizes “page saved” toast string. |
| src/Moonglade.Web/wwwroot/js/app/admin.editor.module.mjs | Localizes slug-warning/unsaved text + adds “Kusto” to TinyMCE code sample languages. |
| src/Moonglade.Web/wwwroot/js/app/admin.comments.mjs | Localizes comment manager labels/toasts. |
| src/Moonglade.Web/wwwroot/js/3rd/highlight.kusto.js | Adds highlight.js language definition for Kusto/KQL. |
| src/Moonglade.Web/wwwroot/css/admin.css | Styles the autosave toggle in the admin navbar. |
| src/Moonglade.Web/Resources/Program.zh-Hant.resx | Adds translations for new search/autosave/admin strings. |
| src/Moonglade.Web/Resources/Program.zh-Hans.resx | Adds translations for new search/autosave/admin strings. |
| src/Moonglade.Web/Resources/Program.ja-JP.resx | Adds translations for new search/autosave/admin strings. |
| src/Moonglade.Web/Resources/Program.de-DE.resx | Adds translations for new search/autosave/admin strings. |
| src/Moonglade.Web/Pages/Shared/_PostListEntry.cshtml | Makes keyword highlighting HTML-safe and supports multi-term highlighting. |
| src/Moonglade.Web/Pages/Shared/_Footer.cshtml | Localizes footer strings and language selector ARIA/labels. |
| src/Moonglade.Web/Pages/Search.cshtml | Rebuilds search UI with facets/sort/date filters and paging. |
| src/Moonglade.Web/Pages/Admin/Widgets.cshtml | Localizes widget UI text and provides string datasets for JS. |
| src/Moonglade.Web/Pages/Admin/Settings/Notification.cshtml | Localizes notification settings page strings and test email dataset. |
| src/Moonglade.Web/Pages/Admin/Settings/Image.cshtml | Localizes help text and recommendation text with formatted HTML. |
| src/Moonglade.Web/Pages/Admin/Settings/General.cshtml | Adds localized string dataset for image upload UX and localizes “Favicon”. |
| src/Moonglade.Web/Pages/Admin/Settings/Comment.cshtml | Localizes moderation provider messages and safely formats embedded HTML. |
| src/Moonglade.Web/Pages/Admin/Settings/Appearance.cshtml | Adds localized string dataset for theme deletion. |
| src/Moonglade.Web/Pages/Admin/Settings/Advanced.cshtml | Localizes labels and safely formats embedded HTML help text. |
| src/Moonglade.Web/Pages/Admin/Post.cshtml | Localizes “Outdated” badge and close button label. |
| src/Moonglade.Web/Pages/Admin/Menu.cshtml | Localizes “Open in new tab” and “New Tab” text. |
| src/Moonglade.Web/Pages/Admin/LocalAccount.cshtml | Localizes account page title and security warning content. |
| src/Moonglade.Web/Pages/Admin/EditPost.cshtml | Adds autosave toggle UI + localized strings dataset; localizes various labels. |
| src/Moonglade.Web/Pages/Admin/EditPage.cshtml | Adds localized strings dataset and localizes editor UI text. |
| src/Moonglade.Web/Pages/Admin/Draft.cshtml | Localizes draft loading label. |
| src/Moonglade.Web/Pages/Admin/Comments.cshtml | Adds localized strings dataset entries and localizes close button label. |
| src/Moonglade.Web/Moonglade.Web.csproj | Updates ASP.NET Core health checks/logging package versions. |
| src/Moonglade.Web/Extensions/ServiceCollectionExtensions.cs | Updates Webmention service registration to pass configuration. |
| src/Moonglade.Web/Controllers/PostController.cs | Returns lastModifiedUtc to support autosave/state sync. |
| src/Moonglade.Web/Controllers/MentionController.cs | Maps source rate limit exceeded to HTTP 429. |
| src/Moonglade.Web/Commands/PostManagementCommands.cs | Extends post operation result to include LastModifiedUtc. |
| src/Moonglade.Web/appsettings.json | Adds configuration section for Webmention source rate limiting. |
| src/Moonglade.Moderation/Moonglade.Moderation.csproj | Updates Microsoft.Extensions.Http.Resilience package version. |
| src/Moonglade.IndexNow.Client/Moonglade.IndexNow.Client.csproj | Updates Microsoft.Extensions.Http.Resilience package version. |
| src/Moonglade.ImageStorage/Moonglade.ImageStorage.csproj | Updates Azure Storage Blobs package version. |
| src/Moonglade.Features/Post/SearchPostQuery.cs | Implements richer search query: paging, sorting, facets, and total row count. |
| src/Moonglade.Email.Client/Moonglade.Email.Client.csproj | Updates Microsoft.Extensions.Http.Resilience package version. |
| src/Moonglade.Data/Moonglade.Data.csproj | Updates EF Core relational package version. |
| src/Moonglade.Data.SqlServer/Moonglade.Data.SqlServer.csproj | Updates EF Core SQL Server provider version. |
| src/Moonglade.Data.PostgreSql/Moonglade.Data.PostgreSql.csproj | Updates EF Core + relational package versions for PostgreSQL provider. |
| src/Directory.Build.props | Bumps assembly/file/package version to 15.17.0. |
| FEATURE-ROADMAP.md | Adds an English roadmap/research document including checked-off items implemented here. |
| AGENTS.md | Documents highlight.js language addition conventions and English-only repo content rule. |
Comment on lines
+154
to
+156
| public string Category { get; set; } | ||
| public string Tag { get; set; } | ||
| public string Language { get; set; } |
Comment on lines
+160
to
+164
| public async Task<IActionResult> OnGetAsync( | ||
| string term, | ||
| int p = 1, | ||
| string sort = "newest", | ||
| string category = null, |
Comment on lines
+234
to
+235
| private static string NormalizeSlug(string value) => | ||
| string.IsNullOrWhiteSpace(value) ? null : value.Trim().ToLower(); |
| language = Language, | ||
| startDate = FormatDate(StartDate), | ||
| endDate = FormatDate(EndDate) | ||
| }); |
| TimeProvider timeProvider, | ||
| ILogger<WebmentionSourceRateLimiter> logger) : IWebmentionSourceRateLimiter | ||
| { | ||
| private readonly ConcurrentDictionary<string, RateLimitCounter> _counters = new(StringComparer.OrdinalIgnoreCase); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.